package dev.ece.core.engine;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

public class LoaderItem<T extends Loader> {

	private static final Logger LOG = LogManager.getLogger(LoaderItem.class);
	
	private T item;
	
	public LoaderItem(T item) {
		this.item = item;
	}
	
	public void loading() {
		try {
			LoaderFlush flush = new LoaderFlush();
			this.item.loading(flush);
			flush.finish();
		} catch(Exception e) {
			LOG.error("加载线程异常", e);
		}
	}
	
	public T getItem() {
		return item;
	}

}
